﻿
<link href="~/Assets/css/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
<link href="~/Assets/css/tagmanager.css" rel="stylesheet" />
<link href="~/Assets/css/typeahead.css" rel="stylesheet" />
<script src="~/Assets/js/jquery.form.js"></script>
<script src="~/assets/js/jquery.validate.min.js"></script>
<script src="~/Assets/js/typeahead.bundle.js"></script>
<script src="~/Assets/js/flexflow-controls.js"></script>
<script src="~/Assets/js/tagmanager.js"></script>
<script src="~/Assets/js/handlebars.js"></script>

<div class="row">
    <div class="form-horizontal" role="form" id="frmNodeEditor">
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right" for="temp">流程起始表单:</label>
            <div class="col-sm-9">
                <input type="text" style="width:9em;" id="tempSelector" name="temp" placeholder="表单模板" class="input-medium tm-input tm-input-success tm-input-typeahead">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right">可发起人员:</label>
            <div class="col-sm-9">
                <input type="text" autocomplete="off" id="operatorSelector" placeholder="请输入姓名" style="width:9em;" class="input-medium tm-input tm-input-success tm-input-typeahead" data-type="user" data-original-title="" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right">可发起机构:</label>
            <div class="col-sm-9">
                <input type="text" autocomplete="off" id="organizationSelector" placeholder="请输入名称" style="width:9em;" class="input-medium tm-input tm-input-success tm-input-typeahead" data-type="user" data-original-title="" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label no-padding-right" for="tag">备注:</label>
            <div class="col-sm-9">
                <input type="text" id="tag" name="tag" placeholder="备注" class="col-xs-12 col-sm-9">
            </div>
        </div>
    </div>

</div>

<script>
    function initForm() {
        $("#tag").val(selNode.opt.tag);
        initFormTemplateList("#tempSelector", selNode.opt.formTemplate, {
            hiddenTagListName: "tempSelector",
            maxTags: 1
        });
        initUserList("#operatorSelector", selNode.opt.operators, {
            hiddenTagListName: "operatorSelector"
        });
        initOrganizationList("#organizationSelector", selNode.opt.operators, {
            hiddenTagListName: "organizationSelector"
        });
    }
    function saveForm() {
        selNode.opt.tag = $("#tag").val();
        selNode.opt.formTemplate = $("[name = 'tempSelector']").val();
        selNode.opt.operators = $("[name = 'operatorSelector']").val();
        selNode.opt.organizations = $("[name = 'organizationSelector']").val();
    }
    initForm();
</script>